package com.dcits.account.entity.cto;

import com.alibaba.fastjson.JSON;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @Auther: 2843896844@qq.com
 * @Date: 2021/06/11/13:35
 * @Description:
 */
public class InputObject implements Serializable {

    private Map<String, Object> params = new HashMap<String, Object>();

    private List<Object> beans = new ArrayList<Object>();

    private Object object;

    public InputObject() {
    }

    public Map<String, Object> getParams() {
        return params;
    }

    public List<Object> getBeans() {
        return beans;
    }

    public Object getObject() {
        return object;
    }

    public void setObject(Object object) {
        this.object = object;
    }

    @Override
    public String toString() {
        return "InputObject{" +
                "params=" + params +
                ", beans=" + beans +
                ", object=" + object +
                '}';
    }

    public String toJSONString() {
        return JSON.toJSONString(this);
    }

    public InputObject put(String key, Object value) {
        this.params.put(key, value);
        return this;
    }

    public static InputObject init(String key, String value) {
        InputObject inputObject = new InputObject();
        inputObject.getParams().put(key, value);
        return inputObject;
    }
}
